/**
 * 房屋管理api
 */

import request from '@/utils/request'
import {
    officeApiUrl
} from '@/api/config.js'

const api = officeApiUrl + '/house'
/*
    房产租赁
*/
// 列表
export function getLeaseContractList(data) {
    return request.post(`${api}/findListByRent`, data)
}

// 详情
export function getLeaseContract(id) {
    return request.get(`${api}/findByRentId/${id}`)
}

// 新增
export function addLeaseContract(data) {
    return request.post(`${api}/createByRent`, data)
}

// 编辑
export function updateLeaseContract(data) {
    return request.post(`${api}/editByRent`, data)
}

// 删除
export function removeLeaseContract(data) {
    return request.post(`${api}/deleteByRent`, data)
}

/*
    自有房产
*/
// 列表
export function getHomeOwnershipList(data) {
    return request.post(`${api}/findListByOwner`, data)
}

// 详情
export function getHomeOwnership(id) {
    return request.get(`${api}/findByOwnerId/${id}`)
}

// 新增
export function addHomeOwnership(data) {
    return request.post(`${api}/createByOwner`, data)
}

// 编辑
export function updateHomeOwnership(data) {
    return request.post(`${api}/editByOwner`, data)
}

// 删除
export function removeHomeOwnership(data) {
    return request.post(`${api}/deleteByOwner`, data)
}

/*
    宿舍管理
*/
// 列表
export function getDormitoryList(data) {
    return request.post(`${api}/findListByDrom`, data)
}

// 详情
export function getDormitory(id) {
    return request.get(`${api}/findByDromId/${id}`)
}

// 新增
export function addDormitory(data) {
    return request.post(`${api}/createByDrom`, data)
}

// 编辑入住人
export function updateResidents(data) {
    return request.post(`${api}/editResidents`, data)
}

// 删除
export function removeDormitory(data) {
    return request.post(`${api}/deleteByDrom`, data)
}
// // 枚举值
// export function getLabels(data) {
//     return request.post(`${officeApiUrl}/label-types/query`,data)
// }
/*
    房产台账
*/
// 列表
export function getParameterList(data) {
    return request.post(`${api}/findListAll`, data)
}